package com.blockmeta.bbs.baselibrary.net.callback;

import com.zhy.http.okhttp.callback.StringCallback;

import okhttp3.Response;

/**
 * Created by Administrator on 2017/7/12.
 */

public abstract class MyStringCallback extends StringCallback {

    protected int code;

    /** 通过响应码判断请求是否成功，200 - 300之间或者400都算是成功 */
    @Override
    public boolean validateReponse(Response response, int id) {
        code = response.code();
        return super.validateReponse(response, id)||code<=500;
    }
}
